<template>
    <page-body >
        <view class="page" >
    <view class="flex flex-wrap align-center justify-between benben-position-layout flex centreCoupon_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center centreCoupon_fd0_0'   @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <image class='centreCoupon_fd0_0_c0'  mode="aspectFit"  :src='STATIC_URL+"87.png"'></image>
</view>
    <view   class='flex flex-wrap align-center centreCoupon_fd0_0'      >
        </view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---flex布局flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout centreCoupon_flex_1"    >
            <template v-for = '(item,key0) in moneyList'>
    <view   class='flex flex-direction flex-wrap align-stretch centreCoupon_fd1_0'       :key='key0'>
            <view   class='flex flex-wrap align-center centreCoupon_fd1_0_c0'      >
        <image class='centreCoupon_fd1_0_c0_c0'  mode="aspectFit"  :src='STATIC_URL+"41.png"'></image>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub centreCoupon_fd1_0_c0_c1'      >
            <view   class='flex flex-wrap align-center'      >
        <text class='centreCoupon_fd1_0_c0_c1_c0_c0'  >{{item.name}}</text>
</view>
    <view   class='flex flex-wrap align-center centreCoupon_fd1_0_c0_c1_c1'      >
        <text class='centreCoupon_fd1_0_c0_c1_c1_c0'  >有效期至：</text>
<text class='centreCoupon_fd1_0_c0_c1_c1_c0'  >{{item.end_time}}</text>
</view>
</view>
    <view   class='flex flex-wrap align-center'      >
        <text class='centreCoupon_fd1_0_c0_c2_c0'  >￥</text>
<text class=' centreCoupon_fd1_0_c0_c2_c1'   >
    <text class=' centreCoupon_price1_fd1_0_c0_c2_c1' >{{ item.money | frontPrice }}</text>
    <text class=' centreCoupon_price2_fd1_0_c0_c2_c1' >{{ item.money | laterPrice }}</text>
</text>
</view>
</view>
    <view   class='flex flex-wrap align-center justify-between centreCoupon_fd1_0_c1'      >
        <text class='centreCoupon_fd1_0_c1_c0'  >{{item.content}}</text>
<button class='centreCoupon_fd1_0_c1_c1'  @tap.stop="asdFunc(item.id)"  >立即领取</button>
</view>
</view>
    </template>
    
<benben-empty :list-data="moneyList">
<view class='flex flex-direction flex-wrap align-center centreCoupon_fd1_1' >
<image class='centreCoupon_fd1_1_c0'  mode="widthFix"  :src='STATIC_URL+"104.png"'></image>

</view>
</benben-empty>
</view>
        
<!---flex布局flex布局结束-->
    
    
        </view>
    </page-body>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    
    export default {
        components:{},
        
        
        data(){
			return {"moneyList":[]};
		},
		computed:{
                          userInfo: {
      get() {
        return this.$store.state.userInfo
      },
      set() {
        this.$store.commit('updateUserInfo', value)
      },
    }
		},
		watch:{},
		onLoad(options){
            this.couponListFunc()
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //领券列表
                async couponListFunc(){
                        //请求方法
    //数据验证
    
  let datamoneyList = await this.$api.post(global.apiUrls.post641960f31d0f4, {
    method:'2',user_id:this.userInfo.id
  });
  
  if (datamoneyList.data.code != 1) {
    this.$message.info(datamoneyList.data.msg);
    return
  } 
  let infomoneyList = datamoneyList.data;
  this.moneyList = infomoneyList.data
  
                },
                //优惠券-用户领券
                async asdFunc(id){
                        //请求方法
    //数据验证
    
  let data64196d6a86d0d = await this.$api.post(global.apiUrls.post64196d6a86d0d, {
    id:id
  });
  
  if (data64196d6a86d0d.data.code != 1) {
    this.$message.info(data64196d6a86d0d.data.msg);
    return
  } 
  let info64196d6a86d0d = data64196d6a86d0d.data;
  
  
                    this.couponListFunc()
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:url(image-path('103.png')) no-repeat ,#fff;background-size: 100% auto;
        }
    .centreCoupon_flex_0{
        background:url(image-path('103.png')) no-repeat ,transparent;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .centreCoupon_fd0_0_c0{
        width:20rpx;height:36rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 0rpx 0rpx 32rpx;
    }
    .centreCoupon_fd0_0{
        width:100rpx;height:88rpx;
    }
    .centreCoupon_flex_1{
        padding:360rpx 32rpx 42rpx 32rpx;
    }
    .centreCoupon_fd1_1_c0{
        width:400rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
    }
    .centreCoupon_fd1_1{
        width:100%;padding:50rpx 0rpx 50rpx 0rpx;
    }
    .centreCoupon_fd1_0_c1_c1{
        background:var(--benbenbgColor7);border-radius:24rpx 24rpx 24rpx 24rpx;font-size:24rpx;color:#fff;width:120rpx;height:48rpx;line-height:48rpx;
    }
    .centreCoupon_fd1_0_c1_c0{
        color:var(--benbenFontColor0);font-size:24rpx;font-weight:400;line-height:33rpx;
    }
    .centreCoupon_fd1_0_c1{
        margin:20rpx 0rpx 0rpx 0rpx;
    }
    .centreCoupon_price2_fd1_0_c0_c2_c1{
        font-size:33rpx;
    }
    .centreCoupon_price1_fd1_0_c0_c2_c1{
        font-size:49rpx;
    }
    .centreCoupon_fd1_0_c0_c2_c1{
        color:var(--benbenFontColor5);font-weight:600;
    }
    .centreCoupon_fd1_0_c0_c2_c0{
        color:var(--benbenFontColor5);font-size:33rpx;font-weight:700;line-height:40rpx;
    }
    .centreCoupon_fd1_0_c0_c1_c1_c0{
        color:var(--benbenFontColor2);font-size:24rpx;font-weight:400;line-height:33rpx;
    }
    .centreCoupon_fd1_0_c0_c1_c1{
        margin:8rpx 0rpx 0rpx 0rpx;
    }
    .centreCoupon_fd1_0_c0_c1_c0_c0{
        color:var(--benbenFontColor0);font-size:32rpx;font-weight:500;line-height:45rpx;
    }
    .centreCoupon_fd1_0_c0_c1{
        margin:0rpx 0rpx 0rpx 16rpx;
    }
    .centreCoupon_fd1_0_c0_c0{
        width:122rpx;height:100rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
    }
    .centreCoupon_fd1_0_c0{
        border-bottom:1px dashed rgba(221, 221, 221, 1);padding:0rpx 0rpx 14rpx 0rpx;
    }
    .centreCoupon_fd1_0{
        background:url(image-path('40.png')) no-repeat ,transparent;background-size:100% 100% !important;padding:30rpx 31rpx 30rpx 34rpx;margin:24rpx 0rpx 0rpx 0rpx;
    }
</style>